package com.dycloud.project.controller;


import com.dycloud.project.service.IndexService;
import com.dycloud.project.web.domain.AjaxResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : renhang
 * @description IndexController
 * @date : 2025-07-03 23:36
 **/
@RestController
@RequestMapping("/index")
public class IndexController {


    @Resource
    private IndexService indexService;


    /**
     * 首页分析
     *
     * @return: @return {@link AjaxResult }
     */
    @GetMapping(value = "/analyze")
    public AjaxResult analyze() {
        return AjaxResult.success(indexService.analyze());
    }


    /**
     * 最近一周趋势
     *
     * @return  @return {@link AjaxResult }
     */
    @GetMapping(value = "publish/trend")
    public AjaxResult publishTrend() {
        return AjaxResult.success(indexService.publishTrend());
    }
}
